/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityGameObject;

import java.util.Vector;

/**
 *
 * @author Van persie
 */
public class Pet extends AbsEntityGameObject {

    public static final int EXP = 0;
    public static final int LEVEL = 1;
    public static final int POINTS = 2;
    public static final int SPEED = 3;
    public static final int TONGUELEN = 4;
    public static final int MONEY = 5;
    public static final int EMOTION_SAD = 0;
    public static final int EMOTION_HAPPY = 1;
    public static final int STATUS_HUNGRY = 2;
    public static final int STATUS_FULL = 3;
    public static final int TIRED = 4;
    public static final int NORMAL = 4;
    int exp;
    private int explvlup;
    private int level;
    int points;
    private int emotion;
    private boolean isHappy;
    private boolean isFull;
    private int status;
    private boolean isTired;
    private int speed;
    private int tongueLen;
    private int money;
    private int stamina;
    
    private int agility;
    private int strength;
    private long score;
    private long highscore;
    private String name;
    private Vector listItems = null;

    public Pet() {
        stamina = 20;
        strength = 10;
        
        agility = 5;
        speed = 5;

        
        exp = 10;
        level = 1;
        points = 1;
        speed = 5;

        tongueLen = 20;
        money = 20;
        emotion = 100;
        status = 100;

        listItems = new Vector();


        // LastPlay = System.currentTimeMillis();
    }

    public void AddAttributes(int AttType, int Increment) {
        switch (AttType) {
            case EXP:
                exp += Increment;
                if (exp >= getExplvlup()) {
                    level++;
                    exp = 0;
                } else if (exp + Increment >= 0) {
                    exp += Increment;
                }
                break;
            case LEVEL:
                setLevel(getLevel() + Increment);
                break;

            case POINTS:
                points += Increment;
                break;

            case SPEED:
                setSpeech(getSpeech() + Increment);
                break;

            case TONGUELEN:
                setTongueLen(getTongueLen() + Increment);
                break;
            case MONEY:
                money += Increment;
                break;
        }
    }

    public int GetAttributes(int AttType) {
        int i = -1;
        switch (AttType) {
            case EXP:
                i = exp;
                break;
            case LEVEL:
                i = getLevel();
                break;

            case POINTS:
                i = points;
                break;

            case SPEED:
                i = getSpeech();
                break;

            case TONGUELEN:
                i = getTongueLen();
                break;
            case MONEY:
                i = getMoney();
                break;
        }
        return i;
    }

    public void SetAttributes(int AttType, int Value) {
        switch (AttType) {
            case EXP:
                exp = Value;
                break;
            case LEVEL:
                setLevel(Value);
                break;

            case POINTS:
                points = Value;
                break;

            case SPEED:
                setSpeech(Value);
                break;

            case TONGUELEN:
                setTongueLen(Value);
                break;

            case MONEY:
                setMoney(money);
                break;
        }
    }

    /**
     * @return the tongueLen
     */
    public int getTongueLen() {
        return tongueLen;
    }

    /**
     * @param tongueLen the tongueLen to set
     */
    public void setTongueLen(int tongueLen) {
        this.tongueLen = tongueLen;
    }

    /**
     * @return the emotion
     */
//    public int getEmotion() {
//        return emotion;
//    }
//
//    /**
//     * @param emotion the emotion to set
//     */
//    public void setEmotion(int emotion) {
//        this.emotion = emotion;
//    }
//
//    /**
//     * @return the status
//     */
//    public int getStatus() {
//        return status;
//    }
//
//    /**
//     * @param status the status to set
//     */
//    public void setStatus(int status) {
//        this.status = status;
//    }
    /**
     * @return the money
     */
    public int getMoney() {
        return money;
    }

    /**
     * @param money the money to set
     */
    public void setMoney(int money) {
        this.money = money;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the stamina
     */
    public int getStamina() {
        return stamina;
    }

    /**
     * @param stamina the stamina to set
     */
    public void setStamina(int stamina) {
        if(stamina < getMaxStamina())
            this.stamina = stamina;
    }

    /**
     * @return the listItems
     */
    public Vector getListItems() {
        return listItems;
    }

    /**
     * @param listItems the listItems to set
     */
    public void setListItems(Vector listItems) {
        this.listItems = listItems;
    }

    /**
     * @return the speed
     */
    public int getSpeech() {
        return getSpeed();
    }

    /**
     * @param speed the speed to set
     */
    public void setSpeech(int speed) {
        this.setSpeed(speed);
    }

    /**
     * @return the level
     */
    public int getLevel() {
        return level;
    }

    /**
     * @param level the level to set
     */
    public void setLevel(int level) {
        this.level = level;
    }

    /**
     * @return the isTired
     */
    public boolean getIsTired() {
        return isTired;
    }

    /**
     * @param isTired the isTired to set
     */
    public void setIsTired(boolean isTired) {
        this.isTired = isTired;
    }

    /**
     * @return the isHappy
     */
    public boolean isIsHappy() {
        return isHappy;
    }

    /**
     * @param isHappy the isHappy to set
     */
    public void setIsHappy(boolean isHappy) {
        this.isHappy = isHappy;
    }

    /**
     * @return the isFull
     */
    public boolean isIsFull() {
        return isFull;
    }

    /**
     * @param isFull the isFull to set
     */
    public void setIsFull(boolean isFull) {
        this.isFull = isFull;
    }

    /**
     * @return the status
     */
    public int getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(int status) {
        this.status = status;
    }

    /**
     * @return the emotion
     */
    public int getEmotion() {
        return emotion;
    }

    /**
     * @param emotion the emotion to set
     */
    public void setEmotion(int emotion) {
        this.emotion = emotion;
    }

    /**
     * @return the score
     */
    public long getScore() {
        return score;
    }

    /**
     * @param score the score to set
     */
    public void setScore(long score) {
        this.score = score;
    }

    /**
     * @return the highscore
     */
    public long getHighscore() {
        return highscore;
    }

    /**
     * @param highscore the highscore to set
     */
    public void setHighscore(long highscore) {
        this.highscore = highscore;
    }

    /**
     * @return the explvlup
     */
    public int getExplvlup() {
        return explvlup;
    }

    /**
     * @param explvlup the explvlup to set
     */
    public void setExplvlup(int explvlup) {
        this.explvlup = explvlup;
    }

    /**
     * @return the strength
     */
    public int getStrength() {
        return strength;
    }
    public int getMaxStamina() {
        return strength*10;
    }

    /**
     * @param strength the strength to set
     */
    public void setStrength(int strength) {
        this.strength = strength;
    }

    /**
     * @return the agility
     */
    public int getAgility() {
        return agility;
    }

    /**
     * @param agility the agility to set
     */
    public void setAgility(int agility) {
        this.agility = agility;
    }

    /**
     * @return the speed
     */
    public int getSpeed() {
        return speed;
    }

    /**
     * @param speed the speed to set
     */
    public void setSpeed(int speed) {
        this.speed = speed;
    }
}
